<?php echo(HTML::script('plugins/form-xeditable/bootstrap3-editable/js/bootstrap-editable.min.js'));?> 
<?php echo HTML::contenido('js/plugins/form-multiselect/css/multi-select.css'); ?>
<?php echo HTML::contenido('js/plugins/form-toggle/toggles.css'); ?>
<?php echo(HTML::script('plugins/form-multiselect/js/jquery.multi-select.min.js'));?>


    <div id="page-heading">
      <ol class="breadcrumb">
        <li><a href="<?php echo(url('/'));?>">Portada</a></li>
        <li>Perfil</li>
        <li class="active">Usuari</li>
      </ol>
    </div>
	<div class="container">
	  	<div class="col-sm-12">
							<div class="panel ">
							  <div class="panel-heading">
							    <h4>
							      <ul class="nav nav-tabs">
							      <li class="active small"><a data-toggle="tab" href="#perfil"><i class="fa fa-user" style="color:grey;"></i> Perfil</a></li>
							      <li class="small"><a data-toggle="tab" href="#gestores"><i class="fa fa-edit" style="color:grey"></i> Gestors</a></li>
							      <li class="small"><a data-toggle="tab" href="#configuracion_usuario"><i class="fa fa-cog" style="color:grey;"></i> Configuració</a></li>
							    </ul>
							  </h4>
							  </div>
							  <div class="panel-body">
							    <div class="tab-content">
							      <div id="perfil" class="tab-pane active"><div class="row">
											<div class="col-sm-2">
												<div class="pull-center" onclick="javascript:alert('foto');" style="text-align:center">
													<img alt="Profile Picture" class="img-rounded zoom1" src="contenido/img/profile-avatar.png">
												</div>
												</p>
												<div class="col-sm-12" style="text-align:center">
													<h3 ><?php echo(Auth::user()->nombre); ?></h3>
												</div>
												<div class="contact col-sm-12">
														<a class="btn btn-block btn-rojo" href="<?php echo(url('bustia'));?>"><i class="fa fa-envelope-o"></i> Enviar missatge</a>
												</div>
											</div>
											<div class="col-sm-9" style="border-left:1px solid #ddd;">
																				
												<div class="user-info-right">
													<div class="basic-info">
														<h3><i class="fa fa-user"></i> Informació Básica</h3>
														<p class="data-row">
															<span class="data-name col-sm-1" >Usuari</span>
															<span class="data-value"><?php echo(Auth::user()->usuario); ?></span>
														</p>
														<p class="data-row">
															<span class="data-name col-sm-1">Nom</span>
															<span class="data-value"><?php echo(Auth::user()->nombre); ?></span>
														</p>
														<p class="data-row">
															<span class="data-name col-sm-1">Creat</span>
															<span class="data-value"><?php echo(Auth::user()->created_at); ?></span>
														</p>
														<p class="data-row">
															<span class="data-name col-sm-1">Últim</span>
															<span class="data-value"><?php echo(Auth::user()->updated_at); ?></span>
														</p>
														<p class="data-row">
															<span class="data-name col-sm-1">Rol</span>
															<span class="data-value"><?php echo($perfil['info']->permiso); ?></span>
														</p>
														<p class="data-row">
															<span class="data-name col-sm-1">Actiu</span>
															<span class="data-value"><?php echo($perfil['info']->activo); ?></span>
														</p>

													</div>
													<div class="contact_info">
														<h3><i class="fa fa-linux"></i> Contact Information</h3>
														<p class="data-row">
															<span class="data-name col-sm-1">Email</span>
															<span class="data-value"><?php echo(Auth::user()->email); ?></span>
														</p>
													</div>

												</div>
											</div>
										</div></div>
							      <div id="gestores" class="tab-pane">
							      	<div class="row">
									    <div class="col-sm-12">
									        <div class="panel ">
									            <div class="panel-heading">
									                <h4>Gestors disponibles</h4>
									          </div>
									          <div class="panel-body">
									            <div class="table-flipscroll">
									                <table class="table">
									                    <thead>
									                        <tr>
									                           <th width="15%">Gestor</th>
									              			   <th width="15%">Vista defecte</th>
									              			   <th width="25%">Mostrar</th>
									                        </tr>
									                    </thead>
									                    <tbody>
									                        <?php 
									                        $i=1;
									                        foreach($perfil['gestores'] as $row){ ?>
									              						<tr>
										              						<td><span class="badge badge-info"><?php echo($i);?></span> <?php echo $row->nombre; ?></td>
										              						<td><?php echo $row->vista; ?></td>
										              						<?php if($row->activo == 'true'){ ?>
										              							<td><input type="checkbox" checked onclick="javascript:alert('<?php echo($row->id);?>');" id="checkbox_<?php echo $row->id; ?>"></input></td>
										              						<?php }else if($row->activo == 'false'){ ?>
										              							<td><input type="checkbox"  onclick="javascript:alert('<?php echo($row->id);?>');" id="checkbox_<?php echo $row->id; ?>"></input></td>
										              						<?php } ?>
									              						</tr>
									              			<?php $i++; }?>
				
									
									                    </tbody>
									                </table>
									            </div>
									          </div>
									        </div>
									    </div>
									</div>

								</div>
								<div id="configuracion_usuario" class="tab-pane">
								<div class="col-md-6">
								<div class="table-responsive">
									<table class="table table-condensed">
									<tbody>
									   <h4><i class="fa fa-edit"></i> Canviar dades usuari</h4>
										<tr>
											<td><?php echo(Lang::get('usuarios.nombre_usuario'));?></td>
											<td><a href="" id="nombre_usuario" class="conf_usuario"
												data-type="text" data-pk="1"
												data-title="<?php echo Lang::get('usuarios.editar_nombre_usuario');?>"><?php echo(Auth::user()->nombre);?></a></td>
										</tr>
										<tr>
											<td><?php echo Lang::get('usuarios.contrasenya');?></td>
											<td><a href="" id="contrasenya" class="conf_usuario password"
												data-type="password" data-pk="1" data-placement="right"
												data-placeholder="Required"
												data-title="<?php echo Lang::get('usuarios.contraseña_nueva');?>">******</a></td>
										</tr>
										<tr id="repetir_contrasenya" style="display: none">
											<td><?php echo Lang::get('usuarios.repetir_contrasenya');?></td>
											<td><a href="" id="contrasenya2" class="conf_usuario password"
												data-type="password" data-pk="1" data-placement="right"
												data-placeholder="Required"
												data-title="<?php echo Lang::get('usuarios.rep_contraseña_nueva');?>">******</a></td>
										</tr>
										<tr>
											<td><?php echo Lang::get('usuarios.email');?></td>
											<td><a href="" id="email" class="conf_usuario"
												data-type="email" data-pk="1" data-placement="right"
												data-placeholder="Required"
												data-title="<?php echo Lang::get('usuarios.email_nuevo');?>"><?php echo Auth::User()->email;?></a></td>
										</tr>
										<tr id="repetir_email" style="display: none">
											<td><?php echo Lang::get('usuarios.repetir_email');?></td>
											<td><a href="" id="email2" class="conf_usuario"
												data-type="email" data-pk="1" data-placement="right"
												data-placeholder="Required"
												data-title="<?php echo Lang::get('usuarios.rep_email_nuevo');?>"><?php echo Auth::User()->email;?></a></td>
										</tr>
									</tbody>
									</table>
									<h4><i class="fa fa-user"></i> Privacitat</h4>
									<div class="simple-checkbox">
										<input type="checkbox" id="checkbox">
										<label for="checkbox">Ocultar perfil</label>
									</div>
									<div class="simple-checkbox">
										<input type="checkbox" id="checkbox">
										<label for="checkbox">Mostrar nom</label>
									</div>
									<div class="simple-checkbox">
										<input type="checkbox" id="checkbox">
										<label for="checkbox">Mostrar email</label>
									</div>
								</div>
								
								
								</div>
									
							    </div>
							  </div>
							</div>
						</div>

	</div>
</div>


<?php echo(HTML::script('usuarios.js'));?>
